[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Int D4 Fn 04  - PC-mos/386 V3.0+ - Get Task Control Block                  [O]

   AH = 04h
   BX = task ID or FFFFh for calling task

Return: CF clear if successful
       ES = segment of Task Control Block (TCB) (see below)
   CF set on error
       AX = error code (see INT 21/AH=59h)

Note:  superseded by AH=27h

See Also: AH=02h,AH=27h,AH=28h,AH=29h,AH=2Ah,INT 38

Format of Task Control Block:
Offset Size    Description
 00h   BYTE    signature byte "H" if allocated from system memory pool
 01h   BYTE    header block ID, "T" = TCB
 02h   WORD    length of block in paragraphs
 04h   WORD    segment address of next header block (0000h if last)
 06h   WORD    segment address of previous header block (0000h if first)
 08h   WORD    pointer to next TCB
 0Ah   WORD    pointer to previous TCB
 0Ch   WORD    pointer to associated TCB (if applicable)
 0Eh   WORD    reserved
---TCB---
 10h   WORD    TCB task ID
 12h   WORD    native context save area
 14h   WORD    start address of task
 16h   WORD    end address of task
 18h   BYTE    task priority
 19h   BYTE    task time slice
 1Ah   BYTE    "TCBWAIT" run status of task
 1Bh   BYTE    "TCBSTAT" what the task is waiting for
 1Ch   DWORD   address of polling routine
 20h   BYTE    error code from last function call
 21h 11 BYTEs  name of currently executing task
 2Ch  4 BYTEs  ???
 30h   BYTE    keyboard disabled if bit 1 set
 31h   BYTE    current shift state and toggles
 32h  2 BYTEs  ???
 34h   BYTE    current video mode
 35h   BYTE    current video page
 36h   BYTE    number of text columns per screen
 37h   BYTE    number of text rows per screen
 38h   WORD    length of video buffer
 3Ah   WORD    video page length
 3Ch   WORD    apge start address in video RAM
 3Eh  4 WORDs  current cursor positions for four screen pages
 46h  8 BYTEs  ???
 4Eh   WORD    current cursor type
 50h   BYTE    current palette setting
 51h   BYTE    original video mode
 52h   BYTE    start CRT row (00h or 01h)
 53h   BYTE    video RAM in task active
 54h   WORD    handle of video save area
 56h   WORD    page count of video save area
 58h   WORD    segment address of video save area
 5Ah   WORD    poitner to first Task File Block (see below)
 5Ch   WORD    pointer to first Current Directory Block (see below)
 5Eh   WORD    pointer to active Current Directory Block (see below)
 60h   BYTE    number of drives
 61h   BYTE    current drive (0=A:, etc.)
 62h   DWORD   disk transfer address
 66h  4 BYTEs  ???
 6Ah   BYTE    verify flag (nonzero = on)
 6Bh   BYTE    break flag (nonzero = on)
 6Ch   WORD    share/lock retry count
 6Eh   WORD    ticks between share/lock retries
 70h   BYTE    remote printer flags (see below)
 71h   BYTE    ETX/ACK delay count
 72h   WORD    spooler segment address
 74h  2 BYTEs  ???
 76h  3 BYTEs  remote printer redirection for LPT1 through LPT3 (see below)
 79h  2 BYTEs  ???
 7Bh   DWORD   offset of username in TCB
 7Fh   BYTE    current output class
 80h  7 BYTEs  protection access rights, 2 bits per class (writeable!)
 87h 122 BYTEs ???
101h   BYTE    TCB sleep downcounter value
102h 20 BYTEs  ???
116h   BYTE    last scan code
   ...
5D0h   DWORD   far pointer to Device Driver Terminal's entry point
5D4h   WORD    offset of logical screen
5D6h   WORD    segment of logical screen
5D8h   WORD    cursor offset within page
5DAh   BYTE    screen columns
5DBh   WORD    async port number (0000h = none)
5DDh   DWORD   physical baudrate
5E1h 19 BYTEs  reserved for Device Driver Terminal (DDT)
   ...
7A6h   DWORD   far pointer to unregister calling chain

Bitfield for remote printer flags:
 bit 0 LPT1 to terminal
 bit 1 LPT2 to terminal
 bit 2 LPT3 to terminal
 bit 3 escape to printer pending
 bit 4 use XON/XOFF
 bit 5 use ETX/ACK
 bit 6 waiting for ACK or XON
 bit 7 transparent printing on

Values for remote printer redirection:
 00h   not redirected
 01h   redirected to COM1
 ...
 18h   redirected to COM24
 51h   redirected to LPT1
 52h   redirected to LPT2
 53h   redirected to LPT3

Format of Task File Block:
Offset Size    Description
 00h   BYTE    signature byte "H" if allocated from system memory pool
 01h   BYTE    header block ID, "F" = task file block
 02h   WORD    length of block in paragraphs
 04h   WORD    segment address of next header block (0000h if last)
 06h   WORD    segment address of previous header block (0000h if first)
 08h   WORD    pointer to next TCB
 0Ah   WORD    pointer to previous TCB
 0Ch   WORD    pointer to associated TCB (if applicable)
 0Eh   WORD    reserved
---TFB---
 10h   WORD    segment address of next TFB
 12h   WORD    segment address of previous TFB
 14h   WORD    segment address of TFB's Global File Block (see below)
 16h   WORD    segment address of owner's PSP
 18h   WORD    file handle
 1Ah  3 BYTEs  ???
 1Dh   DWORD   file position
 21h  4 BYTEs  ???
 25h   BYTE    IOCTL flags (see below)
 26h  2 BYTEs  ???

Bitfields for IOCTL flags:
 bit 0 stdin
 bit 1 stdout
 bit 2 null device
 bit 3 clock device
 bit 4 reserved
 bit 5 ASCII mode instead of binary
 bit 6 EOF encountered on input
 bit 7 device rather than file

Format of Global File Block:
Offset Size    Description
 00h   BYTE    signature byte "H" if allocated from system memory pool
 01h   BYTE    header block ID, "G" = global file block
 02h   WORD    length of block in paragraphs
 04h   WORD    segment address of next header block (0000h if last)
 06h   WORD    segment address of previous header block (0000h if first)
 08h   WORD    pointer to next TCB
 0Ah   WORD    pointer to previous TCB
 0Ch   WORD    pointer to associated TCB (if applicable)
 0Eh   WORD    reserved
---GFB---
 10h 10 BYTEs  ???
 1Ah   WORD    file attribute
 1Ch   BYTE    ???
 1Dh   DWORD   address of device driver
 21h   WORD    first cluster
 23h   WORD    time of last modification
 25h   WORD    date of last modification
 27h   DWORD   size of file in bytes
 2Bh 11 BYTEs  ???
 36h 11 BYTEs  device name or FCB-format filename
 41h   WORD    segment address of TFB list
 43h   WORD    segment address of first RLB (see below) (0000h = none)
 45h   BYTE    flag: nonzero if GFB refers to character device
 46h   WORD    address of Block Device Block (see below)
 48h   WORD    sector of file's directory entry
 4Ah   WORD    high word of file's directory entry
 4Ch   WORD    ofsset of directory entry within sector

Format of Current Directory Block:
Offset Size    Description
 00h   BYTE    signature byte "H" if allocated from system memory pool
 01h   BYTE    header block ID, "C" = current directory block
 02h   WORD    length of block in paragraphs
 04h   WORD    segment address of next header block (0000h if last)
 06h   WORD    segment address of previous header block (0000h if first)
 08h   WORD    pointer to next TCB
 0Ah   WORD    pointer to previous TCB
 0Ch   WORD    pointer to associated TCB (if applicable)
 0Eh   WORD    reserved
---CDB---
 10h   BYTE    drive number
 11h   BYTE    ???
 12h 64 BYTEs  directory name
 52h   WORD    first directory cluster (0000h = root)

Format of Block Device Block:
Offset Size    Description
 00h   BYTE    signature byte "H" if allocated from system memory pool
 01h   BYTE    header block ID, "B" = block device block
 02h   WORD    length of block in paragraphs
 04h   WORD    segment address of next header block (0000h if last)
 06h   WORD    segment address of previous header block (0000h if first)
 08h   WORD    pointer to next TCB
 0Ah   WORD    pointer to previous TCB
 0Ch   WORD    pointer to associated TCB (if applicable)
 0Eh   WORD    reserved
---BDB---
 10h   BYTE    logical drive
 11h   BYTE    unit passed to driver
 12h   WORD    sector size
 14h   BYTE    cluster mask
 15h   BYTE    cluster shift count
 16h   WORD    starting sector of first FAT
 18h   BYTE    number of FATs
 19h   WORD    number of root directories
 1Bh   WORD    sector number of first data sector (cluster 0002h)
 1Dh   WORD    number of clusters + 1 (number of highest data cluster)
 1Fh   BYTE    number of sectors in FAT
 20h   WORD    beginning root directory sector number
 22h   DWORD   device driver address
 26h   BYTE    media descriptor byte
 27h  5 BYTEs  ???
 2Ch   BYTE    flag: volume > 32MB
 2Dh   BYTE    ???
 2Eh   BYTE    number of sectors per cluster
 2Fh   WORD    number of clusters on device
 31h   WORD    number of free clusters (FFFFh = unknown)
 33h   WORD    root directory cluster number
 35h   WORD    pointer to alias/subst string
 37h   WORD    TCB segment address of owner (0000h = none)


Format of Record Lock Block:
Offset Size    Description
 00h   BYTE    signature byte "H" if allocated from system memory pool
 01h   BYTE    header block ID, "R" = record lock block
 02h   WORD    length of block in paragraphs
 04h   WORD    segment address of next header block (0000h if last)
 06h   WORD    segment address of previous header block (0000h if first)
 08h   WORD    pointer to next TCB
 0Ah   WORD    pointer to previous TCB
 0Ch   WORD    pointer to associated TCB (if applicable)
 0Eh   WORD    reserved
---RLB---
 10h   WORD    segment address of owner's PSP
 12h   WORD    segment address of Global File Block (see above)
 14h   WORD    segment address of owner's Task File Block (see above)
 16h   DWORD   file offset of locked region start
 1Ah   DWORD   length of locked region
 1Eh   WORD    owner's handle for file

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson